import _regeneratorRuntime from "@babel/runtime/regenerator";
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
import { CPAAS_IAM, VERSION_IS_OP } from 'utils/config';
import request from 'utils/request';
export function tenantRedirect(_x) {
  return _tenantRedirect.apply(this, arguments);
}

function _tenantRedirect() {
  _tenantRedirect = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(params) {
    var reqUrl;
    return _regeneratorRuntime.wrap(function _callee$(_context) {
      while (1) {
        switch (_context.prev = _context.next) {
          case 0:
            reqUrl = VERSION_IS_OP ? "".concat(CPAAS_IAM, "/v1/user/roles/redirect/page") : "".concat(CPAAS_IAM, "/v1/users/tenant/redirect/page");
            return _context.abrupt("return", request(reqUrl, {
              method: 'GET',
              query: params
            }));

          case 2:
          case "end":
            return _context.stop();
        }
      }
    }, _callee);
  }));
  return _tenantRedirect.apply(this, arguments);
}